package shiqi.ProxyPattern.Permission;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

//测试
public class Client {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        PermissionProxy permissionProxy0 = (PermissionProxy)applicationContext.getBean("permissionProxy0");
        permissionProxy0.modifyNote();
        permissionProxy0.modifyUserInfo();
        permissionProxy0.publishNote();
        permissionProxy0.viewNote();
        System.out.println("----------------");
        PermissionProxy permissionProxy1 = (PermissionProxy)applicationContext.getBean("permissionProxy1");
        permissionProxy1.modifyNote();
        permissionProxy1.modifyUserInfo();
        permissionProxy1.publishNote();
        permissionProxy1.viewNote();
    }
}
